from selenium import webdriver

# 初始化Chrome浏览器
driver = webdriver.Chrome()

try:
    # 获取浏览器的环境信息
    print("浏览器名称：", driver.name)
    print("浏览器版本：", driver.capabilities['browserVersion'])
    print("平台名称：", driver.capabilities['platformName'])

except Exception as e:
    print(f"操作失败：{e}")

finally:
    # 关闭浏览器
    driver.quit()